-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feat] Add image loading indicator #8238
[Feat] Add image loading indicator #8238
Conversation
This pr is slightly different from my initial proposal. I am working on a very similar issue and found a performance related issue #8203 (comment) This pr includes that fix. |
@mdneyazahmad As mentioned in #8203 (comment), would you be able to update this PR with the code from the other one? I would revert the previous one as we dont want to push the problem to staging. Let's make sure it works here thoroughly |
I have updated the body of this PR to also sin #7584 issue. Let's update the code with the lines needed from reverted PR and then test it all here. The features are similar (same). Also dont forget to update the QA and test steps please to reflect that. Thank you very much! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Otherwise, these changes so far look good to me, just as I mentioned, we will need to add the previous PR with the imageLoadingStart
as class functions.
Thanks!
@mountiny I will update it with that fix too. Thank you! |
@mountiny done |
Thanks! @parasharrajat just to clarify, I have asked @mdneyazahmad to include changes from #7584 where we had to revert the PR. These changes are very similar, so it made sense to include them together in one PR which is still manageable and testeable. |
I am fine with it @mountiny . |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you following rules from the checklist? Please carefully follow the checklist. I know this could be an extra effort but reviewers also follow the same. Not following it and putting up the PR for review, will indicate a lack of testing. You have already worked on a few issues, we expect you to be more proactive. Thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a lot of duplicate code across components. Let's dry this up. Thanks.
@parasharrajat I really wanted to discuss the refactoring Image component as it is used at many places. I want to create a wrapper component for |
Sure, sounds good. |
Updated |
I did not create the wrapper component to manage loading state internally because this component will be used at many places and that will not be much useful we still have to manage the loading state and disable user interaction (modal). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can still see one cleanup.
Move the whole loader thing with Image into the component and then just use it everywhere needed. The name could be ImageWithLoader
.
@parasharrajat seems like your specific comment was not submitted. |
Sure thing! On it |
Bug: Loading indicator disappears when going from offline to online in attachment view.
@mdneyazahmad please let me know if you can repro this, and if the steps are clear. Screen.Recording.2022-03-30.at.10.13.33.PM.mov |
@rushatgabhane Great testing! @mdneyazahmad As this is a new feature, we will try to make sure to test this as much as possible. I realize this is taking longer now, so I would be fine with doubling the reward for one of the linked issues 👍 Lets get this bug fixed and make sure everything tested well |
I tested with the steps, but the behaviour is different in my case. At step 4 the loading spinner does not go away have to reopen in order to work (may be due to my internet connection is usually slow). The only condition the spinner go away is either
I do not see this issue. Could you please confirm it? I create a log in the |
IMO, this is not part of this PR. @rushatgabhane you should report this on slack. we should show an inline message to indicate that the image load failed. The loader should stop either when the image is loaded or failed to load. Continuous loader is a bug. |
Okay, I'll start a discussion on slack on how to handle failed pessimistic request for an image. I agree that this should be done in a different issue. |
This comment was marked as off-topic.
This comment was marked as off-topic.
that will not be the case always. We don't always have a thumbnail. And web always needs to fetch the image from the URL. Until we have offline images, we can't do anything. Also, I am totally against showing a low-resolution thumbnail as fullscreen. If you want this, then images should be progressive. |
Okay, I see that Tim is against this too. |
On slow connection it takes time to download the image and it does not trigger |
@mdneyazahmad sorry, I don't understand. If yes, I think it's best that we handle it in a seperate issue |
@rushatgabhane |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mountiny LGTM!
The bug that I mentioned earlier should be dealt in a different issue. Because it's a part of offline UX discussion
(I've started a discussion for this here)
@rushatgabhane @parasharrajat @mdneyazahmad Thank you very much for the discussion here and handling it, I was ooo finishing bachelor thesis 🥵 I agree that showing low resolution picture on fullscreen is big ⛔ And I am happy to sort the slow connection loadings as part of the Offline project pending this PR does not introduce any new problems we havent had before! |
@mdneyazahmad Thank you for your patience on this feature, hopefully, all will work out this time! |
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
@mountiny that makes the two of us 😫 |
@rushatgabhane You got this! |
🚀 Deployed to production by @roryabraham in version: 1.1.51-0 🚀
|
🚀 Deployed to production by @roryabraham in version: 1.1.51-0 🚀
|
This PR is partly responsible for a regression here #15288. The use of more than one callback is bugged (DylanVann/react-native-fast-image#975), in this PR it was the use of both |
This PR has probably caused this regression. Issue: Loading spinner is cut off on long images when reopening the chat |
Details
Adds an image loading indicator when images loads in chat and when an image viewer is opened.
Fixed Issues
$ #7905
$ #7584
Tests
PR Review Checklist
Contributor (PR Author) Checklist
### Fixed Issues
section aboveTests
sectionQA steps
sectionsrc/languages/*
filesSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
displayName
property(i.e.
StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG
)PR Reviewer Checklist
### Fixed Issues
section aboveTests
sectionQA steps
sectionsrc/languages/*
filesSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
displayName
property(i.e.
StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG
)QA Steps
Screenshots
Web
web.mp4
Mobile Web
mweb.mp4
Desktop
desktop.mp4
iOS
ios.mp4
Android
android.mp4